﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KInterfaces
{
    public class KJobFactory
    {
        private static List<KJob> ListJobs = new List<KJob>();
        public static KJob StartNew(string module, string name, string guid, string inParams = "")
        {
            KJob job = new KJob(module, name, guid, inParams);
            return job;
        }

        public static KJob Find(string id)
        {
            int index = ListJobs.FindIndex(r => r.GUID == id);
            if (index >= 0)
            {
                return ListJobs[index];
            }
            else
            {
                return null;
            }
        }
    }
}
